<%%= ibox do %>
  <%%= ibox_title "<%= model_human_name %>详情" %>
  <%%= ibox_content do %>

    <div class="text-center margin-bottom-30">
      <h2 class="title">
        <%- if name_field -%>
        <%%= @<%= "#{singular_name}.#{name_field}" %> %>
        <%- else -%>
        这里是标题
        <%- end -%>
      </h2>

      <%- if image_field -%>
      <%%= image_tag @<%= "#{singular_name}.#{image_field}" %>, class: 'detail-image img-circle' %>
      <%- else -%>
      <%%= image_tag 'placeholders/64s', class: 'detail-image' %>
      <%- end -%>

      <div class="actions">
        <%%= light_button_to '编辑', <%= "edit_#{prefixed_plain_model_url}_path(@#{singular_name})" %>, 'pencil' %>
        <%%# light_method_button_to '删除', <%= "#{prefixed_plain_model_url}_path(@#{singular_name})" %>, 'trash', 'delete', {confirm: '确认删除？'} %>
        <%- if active_enabled? %>
        <%% if @<%= singular_name %>.active %>
          <%%= light_button_to '暂停', <%= "#{prefixed_plain_model_url}_active_path(@#{singular_name})" %>, 'pause', method: :delete %>
        <%% else %>
          <%%= light_button_to '激活', <%= "#{prefixed_plain_model_url}_active_path(@#{singular_name})" %>, 'play', method: :post %>
        <%% end %>
        <%- end -%>
        <%- if recommend_enabled? %>
        <%% if @<%= singular_name %>.recommended %>
          <%%= light_button_to '取消', <%= "#{prefixed_plain_model_url}_recommend_path(@#{singular_name})" %>, 'thumbs-down', method: :delete %>
        <%% else %>
          <%%= light_button_to '推荐', <%= "#{prefixed_plain_model_url}_recommend_path(@#{singular_name})" %>, 'thumbs-up', method: :post %>
        <%% end %>
        <%- end -%>
      </div>
    </div>

    <div data-id="<%%= @<%= singular_name %>.id %>" class="detail-info">
      <div class="full-height-scroll">
        <h4><%= model_human_name %>信息</h4>
        <table class="table table-striped">
          <%- attributes.each do |attribute| -%>
          <tr>
            <td class="info-label"><%%= ::<%= class_name %>.human_attribute_name :<%= attribute.name %> %>：</td>
            <td><%%= @<%= singular_name %>.<%= attribute.name %> %></td>
          </tr>
          <%- end -%>
        </table>
      </div>
    </div>
  <%% end %>
<%% end %>
